public class A {

	@Override
	public PageBean<Movie> findAll(int pageNow) {
		PageBean<Movie> page = new PageBean<>();
		page.setPageNow(pageNow);

		String sql = "Select count(*) From movie";
		page.setRowCount(queryCount(sql));

		sql = "Select * From movie Limit ?, ?";
		page.setList(query(sql, (pageNow-1) * page.getPageSize(), page.getPageSize()));

		

	}


	@Override
	public PageBean<Movie> find_Entity(int pageNow, Movie movie) {
		PageBean<Movie> pb = new PageBean<>();
		List<Object> obj = new ArrayList<>();

		pb.setPageNow(pageNow);

// 查询结果数量
		String sql = "Select count(id) From movie Where 1 = 1";

// movie @Bean
		if (movie.getMovieType().getId() > 0) {
			sql += "and typeid = ?";
			obj.add(movie.getMovieType().getId());
		}

		if (movie.getName() != null) {
			sql += "and name like ? "；
			obj.add(movie.getName());
		}

		if (movie.getStar() != null) {
			sql += "and star like ? ";
			obj.add(movie.getStar());
		}

		pb.setRowCount(queryCount(sql, obj.toArray()));

		sql += "limit ?, ?";

		obj.add((pageNow-1) * pb.getPageSize());
		obj.add(pb.getPageSize());

		pb.setList(queryEntity(sql, obj));

		return null;
	}
}

